<template>
    <div class="ExhibitionListCardBox">
        <div class="CardtopBox">
            <img style="width: 100%;height: 100%;" :src="store.imgfengMian + exhibition.fengmian" alt="">
        </div>
        <div class="CardtopBox_Title">{{ exhibition.name }}</div>
        <div class="CardtopBox_Flex">
            <div class="CardtopBox_text">{{ exhibition.eff_time }}</div>
            <div class="CardtopBox_jlts">距离{{ exhibition.eff_day }}天</div>
        </div>
        <div class="CardtopBox_Flex">
            <div class="CardtopBox_text">容纳人数{{ exhibition.seating_capacity }}</div>
            <div class="CardtopBox_button" @click="detailJump">立即报名</div>
        </div>
    </div>
</template>
<script setup>
import { useRouter } from 'vue-router';
import { useStore } from '@/store/store';
const store = useStore();
const router = useRouter();
const props = defineProps({
    exhibition: {
        type: Object,
        default: () => ({})
    }
})
const detailJump = () => {
    router.push({
        path: '/ExhibitionDetail',
        query: { id:props.exhibition.id }
    });
}
</script>
<style scoped lang="scss">
.ExhibitionListCardBox {
    width: 100%;
    height: 100%;
    background: #fff;
    border-radius: 4px;
    padding: 10px;

    .CardtopBox {
        width: 100%;
        height: 120px;
        margin-bottom: 10px;
    }

    .CardtopBox_Title {
        font-weight: 300;
        font-size: 14px;
        color: #1F1F1F;
        line-height: 1.5;  // 新增行高设置
        height: 42px;       // 两行高度（14px * 1.5 * 2）
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2; // 限制两行
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .CardtopBox_Flex {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-top: 10px;

        .CardtopBox_text {
            font-weight: 300;
            font-size: 12px;
            color: #1F1F1F;
        }

        .CardtopBox_jlts {
            font-weight: 300;
            font-size: 12px;
            color: $green-color;
        }

        .CardtopBox_button {
            background: $button-color;
            border-radius: 4px;
            font-size: 12px;
            color: #FFFFFF;
            padding: 6px 10px;
            cursor: pointer;
        }
    }
}
</style>